From: Paul Donald Date: Sat, 30 Nov 2024 15:19:12 +0000 (+0100) Subject: ddns-scripts: add stop action for individual sections X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=77933a45eaf767883ae4fcd59c7d1520387c22e1;p=feed%2Fpackages.git ddns-scripts: add stop action for individual sections it is now possible to stop an individual instance, and not all of them. Signed-off-by: Paul Donald --- diff --git a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_lucihelper.sh b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_lucihelper.sh index c57e1cf39b..e60b3daf69 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_lucihelper.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_lucihelper.sh @@ -26,6 +26,7 @@ Commands: start start given SECTION reload force running ddns processes to reload changed configuration restart restart all ddns processes + stop stop given SECTION Parameters: -6 => use_ipv6=1 (default 0) @@ -39,7 +40,7 @@ Parameters: -s SCRIPT => ip_script=SCRIPT; ip_source="script" -t => force_dnstcp=1 (default 0) -u URL => ip_url=URL; ip_source="web" - -S SECTION SECTION to start + -S SECTION SECTION to [start|stop] -h => show this help and exit -L => use_logfile=1 (default 0) @@ -161,6 +162,15 @@ case "$1" in sleep 1 "$DDNSPRG" -- start ;; + stop) + if [ -n "$SECTION" ]; then + # section stop + "$DDNSPRG" -S "$SECTION" -- stop + else + # global stop + "$DDNSPRG" -- stop + fi + ;; *) __RET=255 ;; diff --git a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh index 53099aae5c..4f599f6cbf 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh @@ -79,7 +79,11 @@ case "$1" in fi ;; stop) - if [ -n "$INTERFACE" ]; then + if [ -n "$SECTION_ID" ]; then + stop_section_processes "$SECTION_ID" + exit 0 + fi + if [ -n "$NETWORK" ]; then stop_daemon_for_all_ddns_sections "$NETWORK" exit 0 else